/*
  Created on Jul 6, 2005
  (C) 2005 
  @author Michael Long, Adam D. Bradley

  This program is free software; you can redistribute it and/or
  modify it under the terms of Version 2 of the GNU General Public 
  License.
  
  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  General Public License for more details.
  
  You should have received a copy of the GNU Library General Public
  License along with this library; if not, write to the Free
  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

package snobject;

public class snManagedSXE extends snObject {
	private byte[] body;

	public snManagedSXE(java.io.InputStream stream) 
	throws java.io.IOException {
		body = http.Client.drainToByteArray(stream);
	}

	public snManagedSXE(String string) {
		body = string.getBytes();
	}

	public snManagedSXE(byte[] buffer) {
		body = buffer;
	}

	public String getXmlMimeType() { return snobject.MimeTypes.SXE; }
	public String getWebMimeType() { return getXmlMimeType(); }
	public String getBinaryMimeType() { return getXmlMimeType(); }

	public void xmlWrite(java.io.OutputStream out, int depth) throws java.io.IOException {
		step.Node.Indent(out, depth);
		out.write(body);
	}
	public void webWrite(java.io.OutputStream out, int depth) throws java.io.IOException {
		xmlWrite(out,depth);
	}
	public void binaryWrite(java.io.OutputStream out) throws java.io.IOException {
		xmlWrite(out,0);
	}
}